using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Framework
{
    [Serializable]
    public class WrappedList<T> : IList<T>
    {
        [SerializeField] List<T> items;
        
        public WrappedList(List<T> list) => items = list;
        
        public T this[int index]
        {
            get => items[index];
            set => throw new NotImplementedException();
        }
        
        public int IndexOf(T item) => items.IndexOf(item);
        public void Insert(int index, T item) => items.Insert(index, item);
        public void RemoveAt(int index) => items.RemoveAt(index);
        public IEnumerator<T> GetEnumerator() => items.GetEnumerator();
        IEnumerator IEnumerable.GetEnumerator() => items.GetEnumerator();
        public void Add(T item) => items.Add(item);
        public void Clear() => items.Clear();
        public bool Contains(T item) => items.Contains(item);
        public void CopyTo(T[] array, int arrayIndex) => items.CopyTo(array, arrayIndex);
        public bool Remove(T item) => items.Remove(item);
        public int Count => items.Count;
        public bool IsReadOnly => false;
    }
}